<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title></title>
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <link rel="stylesheet" type="text/css" href="/zhenze/Public/home/css/reset.css"/>
    <link rel="stylesheet" href="/zhenze/Public/home/css/shangjia.css"/>
    <link rel="stylesheet" href="/zhenze/Public/home/css/font-awesome.min.css"/>
	<style>
	.btn00{line-height: 1.4rem;width: 16.75rem;margin: 1rem auto;border: none;background:#FF3C00;color: #FFFFFF;font-size:0.75rem;display: block;}
	</style>
</head>
<body>
<div class="top">
    <!--<i class="fa fa-angle-left"></i>-->
    <p>商家</p>
</div>

<div class="cont">
    <p>商家名称：<?php echo ($admininfo["username"]); ?>(<?php echo ($admininfo["realname"]); ?>)</p>
</div>
<div class="containter">
    <h1>所有活动<span>共<?php echo ($count); ?>个活动</span></h1>
    <ul id="gudong">
        <?php if(is_array($listinfo)): $i = 0; $__LIST__ = $listinfo;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$data): $mod = ($i % 2 );++$i;?><a href="<?php echo U('seller/details',array('event_id'=>$data['id']));?>">
                <li>
                    <img  src="<?php echo ($data["event_image"]); ?>"/>
                    <p style="color:#363636;"><?php echo ($data["event_title"]); ?></p>
                    <p><?php echo (date('Y.m.d',$data["event_starttime"])); ?>--<?php echo (date('Y.m.d',$v["event_endtime"])); ?></p>
                    <p><?php echo (mbs_substr($data["event_content"],15)); ?></p>
                    <span style="color:#363636;">参与人数:<?php echo ($data["event_num"]); ?>人</span>
					<?php if($data["event_endtime"] > SYS_TIME ): ?><button class="btnn co01">活动中</button>
					<?php else: ?>
						<button class="btnn co02">已结束</button><?php endif; ?>
                    <div class="clear"></div>
                </li>
            </a><?php endforeach; endif; else: echo "" ;endif; ?>
    </ul>
    <button onclick="getmore()" id="morebtn" data='1' class="btn00">更多</button>
</div>
<script type="text/javascript" src="/zhenze/Public/home/js/jquery-3.1.1.min.js" ></script>
<script src="/zhenze/Public/home/js/screenSize.js" type="text/javascript" charset="utf-8"></script>
<script>
	function getmore(){
		var page=parseInt($('#morebtn').attr("data"))+1;
		$.getJSON("<?php echo U('seller/index');?>&p="+page,function(result){
			$('#morebtn').attr("data",page);//重置当前页数
			var data=result.listinfo;
			if(data.length>0){
				var html="";
				for(var i=0;i<data.length;i++){
					html+='<a href="<?php echo U('seller/details');?>&event_id='+data[i].id+'">';
					html+='	<li>';
					html+='		<img  src="'+data[i].event_image+'"/>';
					html+='		<p style="color:#363636;">'+data[i].event_title+'</p>';
					html+='		<p>'+data[i].event_starttime+'--'+data[i].event_endtime+'</p>';
					html+='		<p>'+data[i].event_content+'</p>';
					html+='		<span style="color:#363636;">参与人数:'+data[i].event_num+'人</span>';
					if(data[i].type==1){
						html+='			<button class="btnn co01">活动中</button>';
					}else{
						html+='			<button class="btnn co02">已结束</button>';
					}
					html+='		<div class="clear"></div>';
					html+='	</li>';
					html+='</a>';
				}
				$("#gudong").append(html);
			}else{
				$("#morebtn").html('亲，没有数据了！');
			}
		});
	}
</script>
</body>
</html>